<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("title", "资讯详情");
%>
<%@ include file="/WEB-INF/views/shared/master/weContentHeader.jsp"%>
<style type="text/css">
.weui-cells:before {
	border-top: 0px;
}

.weui-cell:before {
	border-top: 0px;
}

.showTwo {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
</style>
<%@ include file="/WEB-INF/views/shared/master/weTitle.jsp"%>

<!-- <div style="width: 100%; height: 10px; background-color: #f5f5f5; margin-top: 10px;"></div> -->

<!-- ================================================================================ -->
<input type="hidden" id="type" value="${type}">
<input type="hidden" id="articalId" value="${articalComment.articalId}">
<div class="weui-cell"
	style="align-items: unset; border-bottom: 1px solid #e5e5e5;">
	<div class="weui-cell__hd" style="padding-right: 8px;">
		<img style="width: 40px; height: 40px; padding-top: 5px;border-radius: 50%;" src="${articalComment.customerImg}">
	</div>
	<div class="weui-cell__bd">
		<p style="color: #E49662">
			<c:choose>
				<c:when test="${articalComment.customerName != null}">
					${articalComment.customerName}
				</c:when>
				<c:when test="${articalComment.customerName == null}">
					${articalComment.nickName}
				</c:when>
			</c:choose>
			
			<span style="float:right;">
			<input type="hidden" class="commentId" value="${articalComment.id}">
				<c:choose>
						<c:when test="${articalComment.praiseCustomerId == null}">
								<img alt="" src="<c:url value='/images/we/shareCode/thumb.jpg' />" style="width: 16px; height: 16px; margin: 0px 0px"class="commentThumb"> 
			 					<span style="color: #999">${articalComment.praiseCount}</span>
						</c:when>
						<c:when test="${articalComment.praiseCustomerId != null}">
								<img alt="" src="<c:url value='/images/we/shareCode/thumbed.jpg' />" style="width: 16px; height: 16px; margin: 0px 0px"class="commentThumb"> 
			 					<span style="color: #999">${articalComment.praiseCount}</span>
						</c:when>
				</c:choose>
			</span>
		</p>
		<p style="color: #999; font-size: 0.6rem"><fmt:formatDate value="${articalComment.createTime}" type="date" dateStyle="default" pattern="yyyy-MM-dd HH:mm:ss" /></p>
		<P class="">
			<c:choose>
				<c:when test="${articalComment.replyedId != null}">
				回复<c:choose>
						<c:when test="${articalComment.replyedName != null}">
							<span style="color: #808BC1">@${articalComment.replyedName}:</span>
						</c:when>
						<c:when test="${articalComment.replyedName == null}">
							<span style="color: #808BC1">@${articalComment.replyedNickName}:</span>
						</c:when>
					</c:choose>
				</c:when>
			</c:choose>
				${articalComment.comment}
		</P>
	</div>
	<div class="weui-cell__ft">
		
	</div>
</div>
<!-- ================================================================================ -->


<%@ include file="/WEB-INF/views/shared/scripts/jquery.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/jqweui.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/tabmob.jsp"%>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

<script type="text/javascript">
function goback() {
	var type = $("#type").val();
	var articalId = $("#articalId").val();
	if(type === 'video'){
		window.location.href=$.getVirtualPath()+"/wechat/share/videoDetail?id="+articalId;
	}else if(type === 'artical'){
		window.location.href=$.getVirtualPath()+"/wechat/share/informationDetail?id="+articalId;
	}
	
	
	
}

$(function(){
	toThumbComment();
})
//评论去点赞
function toThumbComment() {
	$(".commentThumb").on('click',function() {
			var $comment = $(this);
			var commentId = $comment.parent().find(".commentId").val();
			var url = $.getVirtualPath()+ "/wechat/share/commentThumb";
			$.post(url,{commentId : commentId},function(res) {
					if (res === false) {
						$comment.attr("src","<c:url value='/images/we/shareCode/thumbed.jpg' />");
						var $praiseCount = $comment.parent().find("span");
						var count = $praiseCount.text();
						count = Number(count) + 1;
						$praiseCount.text(count);
						} else if (res === true) {
							$.toast("你已赞过了哟！", "text");
						}
			}, 'json')
	})

};

</script>


<%@ include file="/WEB-INF/views/shared/master/weContentFooter.jsp"%>
